/**
 * @param {number[][]} matrix
 * @return {void} Do not return anything, modify matrix in-place instead.
 */
var setZeroes = function(matrix) {
  const s1 = new Set()
  const s2 = new Set()
  let m = matrix.length
  let n = matrix[0].length
  for(let i = 0; i < m; i++) {
    for(let j = 0; j < n; j++) {
      if(matrix[i][j] == 0) {
        s1.add(i)
        s2.add(j)
      }
    }
  }
  for(let inx of s1.values()) {
    matrix[inx].fill(0)
  }
  for(let inx of s2.values) {
    for(let i = 0; i < m; i++) {
      matrix[i][inx] = 0
    }
  }
};